const config = {
  // options...
  publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
  productionSourceMap: false,
  runtimeCompiler: true,
  devServer: {
    port: 9090, //  端口
    open: false, //  自动启动浏览器
    https: false, //  https
    proxy: {
      '/api': {
        target: 'http://28.209.3.114:8080',
        changeOrigin: true,
        ws: true,
      },
    },
  },
  configureWebpack(config) {
    config.entry.app = ['babel-polyfill', './src/main.js']
    config.module.rules.push({
      test: /\.m?js$/,
      exclude: /(node_modules|bower_components)/,
      use: {
        loader: 'babel-loader',
        options: {
          plugins: [
            '@babel/plugin-proposal-nullish-coalescing-operator',
            '@babel/plugin-proposal-optional-chaining',
          ],
        },
      },
    })
  },
}
// if (process.env.NODE_ENV === 'production') {
  // 打包的的时候将该依赖转成es5
  config.transpileDependencies = ['major-schedulerpro']
// }
module.exports = config
